.notes-list-container {
    width: var(--notes-list-width);
    transition-property: background-color;
    transition-duration: var(--transition-normal);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 100%;

    &::-webkit-scrollbar {
        display: none;
    }

    &.grid {
        width: 100%;
        background-color: var(--bg-secondary);
    }

    .notes-list-title {
        font: var(--h3);
        padding: var(--spacing-4);
        font-weight: normal;
    }

    a.notes-list-item {
        display: block;
        padding: var(--spacing-4);
        border-bottom: 1px solid var(--neutral-100);
        text-decoration: none;
        color: inherit;
        transition-property: background-color;
        transition-duration: var(--transition-normal);

        &:hover,
        &.is-active {
            background-color: var(--bg-secondary);
        }

        .notes-list-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .notes-list-item-title {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;

            &.untitled {
                color: var(--neutral-300);
            }
        }

        .notes-list-item-pin {
            opacity: 0;
            width: 16px;
            height: 16px;
            transform: translateY(-5px);
            transition: opacity, transform 300ms;

            &.pinned {
                opacity: 1;
                margin-left: 4px;
                flex-shrink: 0;
                transform: translateY(0);

                line,
                circle,
                rect,
                path {
                    stroke-width: 2;
                    stroke: var(--neutral-300);
                    fill: var(--neutral-300);
                }
            }
        }

        .notes-list-item-subcontainer {
            display: flex;
            justify-content: space-between;
            width: 100%;
            overflow: hidden;
            margin-top: 4px;

            .notes-list-item-subtext,
            .notes-list-item-tag {
                font: var(--sm);
                color: var(--neutral-400);
                align-content: end;
                white-space: nowrap;
            }

            .notes-list-item-tags {
                display: flex;
                gap: 4px;
                margin-right: 24px;
                width: 190px;
                overflow: hidden;
                white-space: nowrap;
            }
        }
    }

    .notes-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        padding: 20px;
        padding-top: 0;
        padding-left: 10px;

        &.board {
            display: block;
            position: relative;
            width: 100%;
            height: 100vh;
            padding: 0;
        }

        .notes-grid-item {
            position: relative;
            height: 500px;
            overflow: hidden;
            transition-property: box-shadow;
            transition-duration: var(--transition-normal);
            box-shadow: var(--shadow-2);
            border-radius: 8px;
            padding: 20px;
            border: 1px solid var(--neutral-100);
            background-color: var(--bg-primary);
            display: block;
            text-decoration: none;
            color: inherit;
            cursor: pointer;
            zoom: 0.6;

            &.reveal-animate {
                opacity: 0;
                transform: translateY(20px);
                animation: notes-grid-reveal 0.4s ease-out forwards;
                animation-delay: calc(var(--reveal-index, 1) * 0.05s);
            }

            .notes-grid-item-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 12px;
            }

            .notes-grid-item-title {
                font: var(--h4);

                &.untitled {
                    color: var(--neutral-400);
                }
            }

            .notes-grid-item-pin {
                opacity: 0;
                width: 24px;
                height: 24px;
                transform: translateY(-10px);
                transition: opacity, transform 300ms;

                &.pinned {
                    opacity: 1;
                    margin-left: 4px;
                    flex-shrink: 0;
                    transform: translateY(0);

                    line,
                    circle,
                    rect,
                    path {
                        stroke-width: 2;
                        stroke: var(--neutral-300);
                        fill: var(--neutral-300);
                    }
                }
            }

            .notes-grid-item-content {
                overflow: hidden;
            }

            .notes-grid-item-gradient {
                display: block;
                position: absolute;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 300px;
                background: linear-gradient(180deg, transparent 50%, var(--bg-primary) 100%);
            }

            .notes-grid-item-tags {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                padding: 20px;
                background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 20%);
            }

            &.is-draggable {
                max-height: 300px;
                height: auto;
                display: inline-block;
                width: 200px;
                position: absolute;
                user-select: all;
                -webkit-user-select: all;
                -moz-user-select: all;
                -ms-user-select: all;
                cursor: move;
                transition: transform 0.1s;

                * {
                    user-select: none;
                    -webkit-user-select: none;
                    -moz-user-select: none;
                    -ms-user-select: none;
                    cursor: move;
                    pointer-events: none;
                }

                &.is-dragging {
                    opacity: 0.5;
                }
            }

            &:hover {
                box-shadow: var(--shadow-4);
            }

            &:active {
                transform: scale(0.98);
                transition: transform var(--transition-fast) ease-out;
            }
        }
    }

    .notes-list-load-more-button {
        font: var(--sm);
        color: var(--neutral-400);
        display: flex;
        justify-content: center;
        padding: 36px 0;
        cursor: pointer;
        transition: color 0.5s;

        &:hover {
            color: var(--neutral-600);
        }
    }

    .notes-list-empty-text {
        font: var(--sm);
        padding: var(--spacing-4);
        color: var(--neutral-400);
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 64px;
    }

    .notes-list-spinner {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 64px;
    }
}

@keyframes notes-grid-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media screen and (max-width: 948px) {

    .notes-list-container,
    .notes-grid-container {
        &.is-visible {
            width: 100%;
            height: calc(100% - (var(--mobile-navbar-height) + var(--safe-area-bottom)));
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: calc(var(--mobile-navbar-height) + var(--safe-area-bottom));
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        &.is-hidden {
            display: none;
        }
    }

    .notes-list-container {
        .notes-grid {
            grid-template-columns: repeat(auto-fill, 100%);
        }
    }
}